<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 1.includes 判断某个字符是否在字符串里
        // var str ="abcdefg";
        // console.log(str.includes("defg"));


        // 2.repeat: 可以重复某个字符
        // var str ="*";
        // console.log(str.repeat(5));
        // var str = "fdsafdsaa432a范德萨33发发范德萨";
        // //    var res =  str.replace(/\d+/g,"***");
        // var res = str.replace(/\d+/g,function(arg){
        //     console.log(arg);
        //     return "*".repeat(arg.length);
        // })
        //    console.log(res);

        // 3.padStart(),padEnd() : 根据给的位数补全字符串 
        // var str = "abc";
        // var res =  str.padStart(5,"$");
        // console.log(res);
        // var str = "abc";
        // var res =  str.padEnd(6,".");
        // console.log(res);


        // 4.startsWith : 判断某个字符串 是以某某作为开头
        // endsWidth:
        // var str = "hello world";
        // console.log( str.startsWith("hello"));
        // console.log(str.endsWith("ll"));


    </script>
</body>
</html>